package com.foosun.util;

import java.util.regex.Matcher;
import java.util.regex.Pattern;


/**
 * 解析url工具类
 * @author hj
 *
 */
public abstract class UrlUtils {

		
	/**
	 * 分类列表过滤url
	 * @param servletPath
	 * @return
	 */
	public static String getParamStr(String servletPath){
		String pattern = "/cate_(.*).htm";
		Pattern p = Pattern.compile(pattern, 2 | Pattern.DOTALL);
		Matcher m = p.matcher(servletPath);
		String str= servletPath;
		if (m.find()) {
			str = m.replaceAll("$1");
		}
		return str;
		
	}
	
	
	
	public static void main(String args[]){
		String tmp ="<img alt='' height='650' src='http://s1.mamaxiduo.com/2012/05/H2117032651A55D29.jpg' width='650' /></p>";
		System.out.println(tmp.replaceAll("height='\\d+'", ""));
	}
}
